'use strict';
exports.main = async (event, context) => {
	let appid="wx1ca0a404254fe165"
	let secret="e90b056cd5524e94bdfa56387d5e26a7"
	let url="https://api.weixin.qq.com/sns/jscode2session?appid=" +appid +"&secret=" +secret +"&js_code=" +event.code +"&grant_type=authorization_code"
	let res = await uniCloud.httpclient.request(
		url ,// 请求路径,
		{
			dataType:"json"
		}
	);
	let openid = res.data.openid
	console.log("云函数中openid为",openid)
	return openid
};
